#include "Sampler.h"

#include "FilterSBox.h"
#include "FilterSTriangle.h"
#include "FilterSphere.h"

#include <stdio.h>
#include <cstdlib>

Sampler::Sampler(int num_samples, FilterType ftype) : base_num_samples(num_samples)
{
	if(ftype == FILTER_SBOX)
		filter = new FilterSBox(1.0);
	else if(ftype == FILTER_STRIANGLE)
		filter = new FilterSTriangle(2.0);
	else if(ftype == FILTER_SPHERE)
		filter = new FilterSphere(1.0);
	else {
		printf("Received an invalid filter type in Sampler constructor");
  		exit( 1 );
	}
		
		
}

Sampler::~Sampler()
{
	delete filter;
}

